package com.springmvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

/**
 * @Author: TongRui乀
 * @Date: 2020-05-23 8:45
 * @description：
 */
@Controller
@RequestMapping("hello")
public class HelloController {


    @GetMapping
    public ModelAndView hello(){

        ModelAndView model = new ModelAndView();

        model.setViewName("index");

        return model;
    }


    @GetMapping("hi")
    @ResponseBody
    public String hi(){
        return "Hi";
    }

}
